<%@page import="org.oexam.ostudy.facade.ManageTestsPages"%>
<%@page import="org.oexam.ostudy.facade.struct.TestNameAndId"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"
	import="org.oexam.ostudy.facade.struct.LoggedUserDetails"
	import="org.oexam.ostudy.facade.struct.TestNameAndId"
	import="org.oexam.ostudy.facade.ManageTestsPages"
	import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All tests</title>
<style type="text/css">
body {
	background-color: silver;
}

menu {
	border-style: solid;
	border-color: black;
	min-width: 700px min-height: 700px
}
</style>
</head>
<body>

	<table style="table-layout: auto; min-width: 700px;">
		<tr bgcolor="gray">
			<td colspan="2"><img src="University.gif"
				style="width: 90px; height: 35px" alt="No Image">
				<h1
					style="font-family: cursive; azimuth: left-side; color: #63382E;">
					EXAMPLE UNIVERSITY</h1> <span
				style="font-stretch: ultra-expanded; color: #63382E; font-family: cursive;">
					University Examination and Learning system </span></td>
			<td style="table-layout: auto; min-width: 100px;">
				<%
					LoggedUserDetails loggedUserDetails = (LoggedUserDetails) session
							.getAttribute("userLoginDetails");
				%> Logged in as, <%=loggedUserDetails.getUserName()%>. <br> <a
				href="Logout">logout</a>
			</td>


		</tr>

		<tr valign="top" style="height: 800px">

			<td style="width: 800px; height: 500px" bordercolor="black"><br>
				<%
					if ((session.getAttribute("message") != null)) {
				%> <%=(String) session.getAttribute("message")%> <%
 	session.setAttribute("message", null);
 	}
 %> <br> <br>
				<table border="1" style="border: thin;" bordercolor="grey">
					<tr bgcolor="gray">
						<td>Test ID</td>
						<td>Test Name</td>
						<td colspan="3">Actions</td>
					</tr>
					<%
						List<TestNameAndId> testsList = new ManageTestsPages().getAllTestsLinkedToTeacher(loggedUserDetails.getUserID());

						for (TestNameAndId testName : testsList) {

							String testid = Integer.toString(testName.getId());
					%>

					<tr>
						<td><%=testid%></td>
						<td><%=testName.getTestName()  %></td>
						<td><a
							href="ManageQuestions?action=ViewAndAddQuesToTest&TestID=<%=testid%>">
							View And Add Questions</a></td>

						<%
							}
						%>
					
				</table></td>

			<td style="height: auto; width: auto; text-align: top;"></td>
		</tr>

		<tr>
			<td colspan="3"
				style="background-color: #FFA513; text-align: center;">
				Copyright © 2011 www.exampleuniversity.com. All rights reserved.</td>
		</tr>
	</table>

</body>


</html>